<?php
/**
 * Created by PhpStorm.
 * User: 16020
 * Date: 2018/11/25
 * Time: 14:52
 */

namespace app\admin\Model;


use think\Model;

class Honor extends Model
{
    public function profile()
    {
        return $this->hasOne('User','id','user_id')->field('name as user_name');
    }

    public function ArctypeMod()
    {
        return $this->hasOne('ArctypeMod','id','mod_id')->field('name as am_name');
    }

    public function Label()
    {
        return $this->hasOne('Label','id','label_id')->field('title as label_title');
    }

    public function getLastTimeTurnAttr($value, $data)
    {
        return date('Y-m-d H:i:s', $data['last_time']);
    }
}